package hotciv.tools;

import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

import javax.swing.tree.DefaultTreeCellEditor.EditorContainer;

import minidraw.framework.DrawingEditor;
import minidraw.framework.Tool;
import minidraw.standard.NullTool;
import hotciv.framework.*;
import hotciv.view.GfxConstants;

public class InspectingTool extends NullTool
{
	private Game game;
	private Position position;
	
	
	public InspectingTool(Game game, DrawingEditor editor)
	{
		this.game = game;
	}

	public void mouseUp(MouseEvent e, int x, int y)
	{
		int tileX = (x - GfxConstants.MAP_OFFSET_X)/GfxConstants.TILESIZE;
		int tileY = (y - GfxConstants.MAP_OFFSET_Y)/GfxConstants.TILESIZE;
			//Skips if trying to move outside the world
		if(tileX < GameConstants.WORLDSIZE && tileY < GameConstants.WORLDSIZE)
		{
			position = new Position(tileY, tileX);
			
			game.changeTileFocus(position);
		}
	}
}
